<h1>JIU Course Proposal</h1>
<h2>General Course Info</h2>
<table border="1" width="100%">
<tr>
	<td width="125">Course Number:</td>
	<td><?php echo $row_courses['jiu_course_id']; ?></td>
</tr>
<tr>
	<td>Course Name:</td>
    <td><?php echo $row_courses['name']; ?></td>
</tr>
<tr>
	<td>Date Generated:</td>
	<td><?php echo date('F j, Y'); ?></td>
</tr>
</table>
<h2>Course Author and Contact Information</h2>
<table border="1" width="100%">
<tr>
	<td width="125">Author:</td>
	<td><?php echo $row_author['firstName']." ".$row_author['lastName']; ?></td>
</tr>
<tr>
	<td>Contact Info:</td>
	<td><?php echo $row_author['email'] ?></td>
</tr>
</table>
<h2>Course Overview</h2>
<p>This course introduces students to:</p>
<p><?php echo $row_cd['cd_desc1']; ?></p>
<p>Students will examine a wide range of topics including:</p>
<p><?php echo $row_cd['cd_desc2']; ?></p>
<h2>Introduction</h2>
<p><span class="greenHighlight">[Optional - Provide additional general information regarding  the course and its content.]</span></p>
<h2>Course Objectives and Related Assignments</h2>
<table border="1" width="100%">
  <tr>
    <th width="425" valign="top">Upon completion of this course, students will be able to:</th>
    <th width="175" valign="top">Related Project Deliverable</th>
  </tr>
<?php 
$query_pd_los = sprintf("SELECT lo_text,del_num,id FROM learning_outcomes WHERE cid='%s' ORDER BY mid", $cid);
$pd_los = mysql_query($query_pd_los, $connection) or die(mysql_error());
$row_pd_los = mysql_fetch_assoc($pd_los);

do { 
$query_del = sprintf("SELECT pd_name FROM project_deliverable WHERE id='%s'", $row_pd_los['id']);
$del = mysql_query($query_del, $connection) or die(mysql_error());
$row_del = mysql_fetch_assoc($del);
?>
  <tr>
    <td valign="top"><?php echo $row_pd_los['lo_text']; ?></td>
    <td valign="top">Deliverable <?php echo $row_pd_los['del_num']; ?>: <?php echo $row_del['pd_name']; ?></td>
  </tr>
<?php } while ($row_pd_los = mysql_fetch_assoc($pd_los)); ?>
</table>
<?php if ($totalRows_materials > 0) { ?>
<h2>Required Course Materials </h2>
<ul>
<?php do { ?>
	<?php if ($row_materials['matType'] == "1") { ?>
    <li><?php echo $row_materials['matAuthor']." (".$row_materials['matYear']."). <em>".$row_materials['matTitle']."</em>. ".$row_materials['matCity'].": ".$row_materials['matPublisher']."."; ?></li>
    <?php } 
	if ($row_materials['matType'] == "2") { ?>
    <li><?php echo $row_materials['matAuthor']." (".$row_materials['matYear']."). ".$row_materials['matTitle'].". <em>".$row_materials['matPublisher'].", ".$row_materials['matVolume']."</em>(".$row_materials['matIssue']."), ".$row_materials['matPages']."."; ?></li>
    <?php } 
	if ($row_materials['matType'] == "3") { ?>
    <li><?php echo $row_materials['matAuthor']." (".$row_materials['matYear']."). <em>".$row_materials['matTitle']."</em>. Retrieved from: ".$row_materials['matURL']; ?></li>
    <?php } ?>
<?php } while ($row_materials = mysql_fetch_assoc($materials)); ?>
</ul>
<?php } ?>
<h2>Course Project Description</h2>
<p><?php echo $row_cpd_latest['project_desc1']; ?></p>
<h2>Modules and Related Overviews, Themes, and Assignments</h2>
<?php do { 
$query_assignments = sprintf("SELECT * FROM assignments WHERE cid='%s' AND mid='%s' ORDER BY assign_num ASC", $cid, $row_modules['mid']);
$assignments = mysql_query($query_assignments, $connection) or die(mysql_error());
$row_assignments = mysql_fetch_assoc($assignments);

$query_themes = sprintf("SELECT * FROM themes WHERE cid='%s' AND mid='%s' ORDER BY theme_num ASC", $cid, $row_modules['mid']);
$themes = mysql_query($query_themes, $connection) or die(mysql_error());
$row_themes = mysql_fetch_assoc($themes);
?>
<p>
<table border="1" width="100%">
<tr>
	<th colspan="2"><a name="<?php echo $row_modules['mid']; ?>"></a>Module <?php echo $row_modules['mid']; ?>: <?php echo $row_modules['module_title']; ?></th>
</tr>
	<tr bgcolor="#dddddd">
    	<td colspan="2"><strong>Overview</strong></td>
    </tr>
    <tr>
    	<td colspan="2"><?php echo $row_modules['module_overview']; ?>&nbsp;</td>
    </tr>
	<tr bgcolor="#dddddd">
        <td colspan="2"><strong>Themes</strong></td>
    </tr>
	<?php do { ?>
	<tr>
		<td nowrap="nowrap">Theme <?php echo $row_themes['theme_num']; ?>:</td>
    	<td nowrap="nowrap"><?php echo $row_themes['theme_title']; ?></td>
    </tr>
<?php } while ($row_themes = mysql_fetch_assoc($themes)); ?>
    <tr bgcolor="#dddddd">
        <td colspan="2"><strong>Assignments</strong></td>
    </tr>
	<?php do { ?>
	<tr>
		<td nowrap="nowrap" width="10%">Assignment <?php echo $row_modules['mid'].".".$row_assignments['assign_num']; ?>:</td>
       	<td nowrap="nowrap"><?php echo $row_assignments['assign_title']; ?></td>
    </tr>
	<?php } while ($row_assignments = mysql_fetch_assoc($assignments)); ?>
</table>
</p>
<?php } while ($row_modules = mysql_fetch_assoc($modules)); ?>
